#include <bits/stdc++.h>

#define mem(a, value) memset(a, value, sizeof(a))
#define MINF 0x3f
#define INF 0x3f3f3f3f
using namespace std;

class Solution {
public:
  vector<int> twoSum(vector<int>& nums, int target) {

    int pos[2];

    for(int i = 0; i < nums.size(); ++i){
      vector<int>::iterator it = find(nums.begin(), nums.end(), target - nums[i]);
      if(it != nums.end() && distance(nums.begin(), it) != i){
        pos[0] = i;
        pos[1] = distance(nums.begin(), it);
        break;
      }
    }

    vector<int> ans(pos, pos + 2);

//    printf("%d %d", pos[0], pos[1]);

    return ans;

  }

};